package holdObject;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

public class AddingGruops {

	public static void main(String[] args){
		
		Collection<Integer> collection  = new ArrayList<Integer>(Arrays.asList(1,2,3,4,5));
		Integer[] moreInts = {6,7,8,9,10};
		collection.addAll(Arrays.asList(moreInts));
//		for (Integer i:collection) {
//			System.out.println(i);
//		}
		Collections.addAll(collection, 11,12,13,14,15);
//		for (Integer i:collection) {
//			System.out.println(i);
//		}
		Collections.addAll(collection, moreInts);
		for (Integer i:collection) {
			System.out.println(i);
		}
		
		List<Integer> list = Arrays.asList(16,17,18,19,20);
		list.set(1, 99);
		/*
		 * 因为Arrays.asList在底层存储形式是数组，数组的大小
		 * 是不能在运行时改变的
		 */
//		list.add(21);
	}
	
}
